function BMapLoader(ak) {
  return new Promise((resolve, reject) => {
    if (window.BMapGL) {
      resolve(window.BMapGL);
    } else {
      const script = document.createElement("script");
      script.type = "text/javascript";
      script.src =
        "https://api.map.baidu.com/api?v=1.0&type=webgl&callback=initBMap&ak=" +
        "mV0DScK1RpX85Q7taHl5hTHYCssKtwHO";
      script.async = true;
      script.onerror = reject;
      document.head.appendChild(script);
    }
    window.initBMap = function () {
      resolve(window.BMapGL);
    };
  });
}
export { BMapLoader };
